"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.炮台Handler = void 0;
const Config_1 = require("../../Config");
const GameUtils_1 = __importDefault(require("../GameUtils"));
const BaseHandler_1 = require("./BaseHandler");
class 炮台Handler extends BaseHandler_1.BaseHandler {
    /** 开炮，一段时间后再计算落点上的大子会不会死，有可能空炮 */
    炮台_impact(data, player) {
        this.handlerMgr.spendAction(player, Config_1.Config.COST_炮台_IMPACT);
        let startPoint = this.gameMgr.map_point.get(data.start);
        let big_start = startPoint.big;
        big_start.actionOnce();
        let endPoint = this.gameMgr.map_point.get(data.end);
        this.shellLanding(player, startPoint, endPoint);
    }
    /** 炮弹落地 */
    shellLanding(player, startPoint, endPoint) {
        this.gameMgr.sendBroadcast(GameUtils_1.default.getObj("大炮_bombing", { "start": startPoint.id, "end": endPoint.id }));
        setTimeout(() => {
            let big_end = endPoint.big;
            if (big_end != null) {
                big_end.attacked(player);
            }
        }, 600);
    }
}
exports.炮台Handler = 炮台Handler;
